<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/vue"></script>
</head>
<body>
    <div id="app">
        <my-component>
            <h3>内容区域</h3>
        </my-component>
    </div>

    <template id="mycomponent">
        <div>
            <p>头部区域</p>
            <slot>如果没有分发内容，则显示默认提示</slot>
            <p>底部区域</p>
        </div>
    </template>
</body>
<script type="text/javascript">
var vm=new Vue({
    el:"#app",
    data:{

    },
    components:{
        "my-component":{
            template:"#mycomponent"
        }
    }
})
</script>
</html>